package Blog01;

//动物类
class Animals{
    public String name;

    public Animals(String name) {
        this.name = name;
    }
}

//吃 接口
interface EAT{
    void eat();
}

//跑 接口
interface RUN{
    void run();
}

//飞 接口
interface FLY{
    void fly();
}

//游泳 接口
interface SWIM{
    void swim();
}

class Dog extends Animals implements EAT,RUN{

    public Dog(String name) {
        super(name);
    }

    @Override
    public void eat() {
        System.out.println(this.name + "在吃");
    }

    @Override
    public void run() {
        System.out.println(this.name + "在跑");
    }
}

class Fish extends Animals implements EAT,SWIM{

    public Fish(String name){
        super(name);
    }

    @Override
    public void eat() {
        System.out.println(this.name + "在吃");
    }

    @Override
    public void swim() {
        System.out.println(this.name + "在游");
    }
}

class Duck extends Animals implements EAT,RUN,FLY,SWIM{

    public Duck(String name){
        super(name);
    }

    @Override
    public void eat() {
        System.out.println(this.name + "在吃");
    }

    @Override
    public void run() {
        System.out.println(this.name + "在跑");
    }

    @Override
    public void fly() {
        System.out.println(this.name + "在飞");
    }

    @Override
    public void swim() {

    }
}

public class Blog {
    public static void main(String[] args) {
        Dog dog = new Dog("小狗");
        dog.eat();
        dog.run();

        Fish fish = new Fish("小鱼");
        fish.eat();
        fish.swim();

        Duck duck = new Duck("小鸭子");
        duck.eat();
        duck.fly();
        duck.run();
        duck.swim();
    }

}